home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-04 / zbpc_460.zip / TUTOR.EXE / GRAPH1.DOC < prev    next >
Text File  |  1988-11-14  |  2KB  |  52 lines

  1.                            ZBASIC Graphics
  2. ...
  3. ZBASIC graphics are different from other graphics schemes in
  4. that they are "Device-Independent". This means that they are
  5. done in a standardized format which can be transferred from
  6. machine to machine ... that is a program written for the IBM
  7. and ported over to the TRS-80 will display the same graphics
  8. image adjusted for the resolution of the screen of that machine.
  9. Also, conversion of graphics on the IBM from EGA to CGA to
  10. Hercules is as simple as identifying the type of display, and
  11. there is a special command for that. Also, for the IBM &
  12. Macintosh the coordinate system can be altered, or set to
  13. absolute pixel addressing by COORDINATE or COORDINATE WINDOW.
  14. ...
  15. ZBASIC uses a "Theoretical Palette" with 1024 horizontal and
  16. 768 vertical pixels. Coordinates outside this range (from 8192
  17. to -8192) are supported, though they will not display on the
  18. screen. The MODE Command is used to define the specific graphic
  19. card or machine to be addressed.
  20. ...
  21. Thus to draw a diagonal line the commands would be:
  22. 100 X=CARDTYPE:IFX=255PRINT"No Graphics Card":END
  23. 110 IFX=3 MDE=20 REM Set to Hercules
  24. 120 IFX=0 MDE=7 REM Set to 640x200 CGA, MODE5 for 320x200
  25. 130 IFX=1 MDE=19 REM EGA Color monitor, X=2 would be EGA Mono
  26. 140 MODE MDE : PLOT0,0TO1023,767 REM Draw the line
  27. ...
  28. This would determine the type of monitor, set the MODE and
  29. draw the same line for each type of monitor. If we wanted to
  30. move this image to a KAYPRO CP/M with graphics we would omit
  31. the CARDTYPE lines 100-130 and enter ---
  32. ...
  33. 140 MODE3 : PLOT0,0TO1023,767
  34.  
  35. This would select 120x72 graphics, or MODE 7 would select
  36. 160x100 graphics. If this were a TRS-80 without a graphics
  37. board MODE 7 would select 128x48 (Model I & 3) or 160x72
  38. (Model 4).
  39.  
  40. The PLOT command can be used as a single statement PLOT 20,4
  41. or to draw a line PLOT0,0TO100,100 or as a multiple command
  42. PLOT 10,10TO20,20TO100,400 or from the previous position
  43. PLOT TO100,50.
  44. ...
  45. POINT (X,Y) will also return the color of that coordinate.
  46. ...
  47. BOX and CIRCLE (with RATIO for perspective) are supported,
  48. along with FILL and COLOR (for color machines).
  49.  
  50. PRINT%(X,Y) and INPUT%(X,Y) are offered for text positioning
  51. within graphic modes.
  52.